import { useQuery } from '@tanstack/react-query'
import { apiService } from '../services/api'

// 查询键常量
const QUERY_KEYS = {
  comments: ['comments'] as const,
}

// 获取所有评论
export const useComments = () => {
  return useQuery({
    queryKey: QUERY_KEYS.comments,
    queryFn: apiService.getComments,
  })
}
